package com.atguigu.springcloud.alibaba.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping()
public class InfoController {

    @Value(value = "${spring.cloud.sentinel.datasource.ds1.nacos.server-addr}")
    String ds1_nacos_addr;
    @Value(value = "${spring.cloud.sentinel.datasource.ds1.nacos.namespace}")
    String ds1_nacos_ns;
    @Value(value = "${spring.cloud.sentinel.datasource.ds1.nacos.dataId}")
    String ds1_nacos_di;
    @Value(value = "${spring.cloud.sentinel.datasource.ds1.nacos.groupId}")
    String ds1_nacos_gi;
    @Value(value = "${spring.cloud.sentinel.datasource.ds1.nacos.data-type}")
    String ds1_nacos_dt;
    @Value(value = "${spring.cloud.sentinel.datasource.ds1.nacos.rule-type}")
    String ds1_nacos_rt;

    @Value(value = "${spring.cloud.sentinel.datasource.ds2.nacos.server-addr}")
    String ds2_nacos_addr;
    @Value(value = "${spring.cloud.sentinel.datasource.ds2.nacos.namespace}")
    String ds2_nacos_ns;
    @Value(value = "${spring.cloud.sentinel.datasource.ds2.nacos.dataId}")
    String ds2_nacos_di;
    @Value(value = "${spring.cloud.sentinel.datasource.ds2.nacos.groupId}")
    String ds2_nacos_gi;
    @Value(value = "${spring.cloud.sentinel.datasource.ds2.nacos.data-type}")
    String ds2_nacos_dt;
    @Value(value = "${spring.cloud.sentinel.datasource.ds2.nacos.rule-type}")
    String ds2_nacos_rt;

    @Value(value = "${spring.cloud.sentinel.datasource.ds3.nacos.server-addr}")
    String ds3_nacos_addr;
    @Value(value = "${spring.cloud.sentinel.datasource.ds3.nacos.namespace}")
    String ds3_nacos_ns;
    @Value(value = "${spring.cloud.sentinel.datasource.ds3.nacos.dataId}")
    String ds3_nacos_di;
    @Value(value = "${spring.cloud.sentinel.datasource.ds3.nacos.groupId}")
    String ds3_nacos_gi;
    @Value(value = "${spring.cloud.sentinel.datasource.ds3.nacos.data-type}")
    String ds3_nacos_dt;
    @Value(value = "${spring.cloud.sentinel.datasource.ds3.nacos.rule-type}")
    String ds3_nacos_rt;

    @Value(value = "${spring.cloud.sentinel.datasource.ds4.nacos.server-addr}")
    String ds4_nacos_addr;
    @Value(value = "${spring.cloud.sentinel.datasource.ds4.nacos.namespace}")
    String ds4_nacos_ns;
    @Value(value = "${spring.cloud.sentinel.datasource.ds4.nacos.dataId}")
    String ds4_nacos_di;
    @Value(value = "${spring.cloud.sentinel.datasource.ds4.nacos.groupId}")
    String ds4_nacos_gi;
    @Value(value = "${spring.cloud.sentinel.datasource.ds4.nacos.data-type}")
    String ds4_nacos_dt;
    @Value(value = "${spring.cloud.sentinel.datasource.ds4.nacos.rule-type}")
    String ds4_nacos_rt;

    @GetMapping(value = "/getruleinfo")
    public String getInfo() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("ds1_nacos_addr:").append(ds1_nacos_addr).append("\r\n").append("<br/>");
        stringBuilder.append("ds1_nacos_ns:").append(ds1_nacos_ns).append("\r\n").append("<br/>");
        stringBuilder.append("ds1_nacos_di:").append(ds1_nacos_di).append("\r\n").append("<br/>");
        stringBuilder.append("ds1_nacos_gi:").append(ds1_nacos_gi).append("\r\n").append("<br/>");
        stringBuilder.append("ds1_nacos_dt:").append(ds1_nacos_dt).append("\r\n").append("<br/>");
        stringBuilder.append("ds1_nacos_rt:").append(ds1_nacos_rt).append("\r\n").append("<br/>");
        stringBuilder.append("==================================================").append("\r\n").append("<br/>");
        stringBuilder.append("ds2_nacos_addr:").append(ds2_nacos_addr).append("\r\n").append("<br/>");
        stringBuilder.append("ds2_nacos_ns:").append(ds2_nacos_ns).append("\r\n").append("<br/>");
        stringBuilder.append("ds2_nacos_di:").append(ds2_nacos_di).append("\r\n").append("<br/>");
        stringBuilder.append("ds2_nacos_gi:").append(ds2_nacos_gi).append("\r\n").append("<br/>");
        stringBuilder.append("ds2_nacos_dt:").append(ds2_nacos_dt).append("\r\n").append("<br/>");
        stringBuilder.append("ds2_nacos_rt:").append(ds2_nacos_rt).append("\r\n").append("<br/>");
        stringBuilder.append("==================================================").append("\r\n").append("<br/>");
        stringBuilder.append("ds3_nacos_addr:").append(ds3_nacos_addr).append("\r\n").append("<br/>");
        stringBuilder.append("ds3_nacos_ns:").append(ds3_nacos_ns).append("\r\n").append("<br/>");
        stringBuilder.append("ds3_nacos_di:").append(ds3_nacos_di).append("\r\n").append("<br/>");
        stringBuilder.append("ds3_nacos_gi:").append(ds3_nacos_gi).append("\r\n").append("<br/>");
        stringBuilder.append("ds3_nacos_dt:").append(ds3_nacos_dt).append("\r\n").append("<br/>");
        stringBuilder.append("ds3_nacos_rt:").append(ds3_nacos_rt).append("\r\n").append("<br/>");
        stringBuilder.append("==================================================").append("\r\n").append("<br/>");
        stringBuilder.append("ds4_nacos_addr:").append(ds4_nacos_addr).append("\r\n").append("<br/>");
        stringBuilder.append("ds4_nacos_ns:").append(ds4_nacos_ns).append("\r\n").append("<br/>");
        stringBuilder.append("ds4_nacos_di:").append(ds4_nacos_di).append("\r\n").append("<br/>");
        stringBuilder.append("ds4_nacos_gi:").append(ds4_nacos_gi).append("\r\n").append("<br/>");
        stringBuilder.append("ds4_nacos_dt:").append(ds4_nacos_dt).append("\r\n").append("<br/>");
        stringBuilder.append("ds4_nacos_rt:").append(ds4_nacos_rt).append("\r\n").append("<br/>");
        stringBuilder.append("==================================================").append("\r\n").append("<br/>");

        return stringBuilder.toString();
    }




}
